<#assign pageTitle = "课程列表" />
<#assign pageHeader>
	<script type="text/javascript">
		var channelId = ${courseQuery.channelId!};
		var categoryId = ${courseQuery.categoryId!};
		var teacherId = ${courseQuery.teacherId!};
		var memberTypeId = ${courseQuery.memberTypeId!};
		var orderBy = ${courseQuery.orderBy!};
		var isFree = ${courseQuery.isFree!};
		var isLiving = ${courseQuery.isLiving!};
		var sellType = "${courseQuery.sellType!}";
		var currentPage = ${page.currentPage};
		var totalPage = ${totalPages};
	</script>
</#assign>
<#assign pageContent>
	<div id="aCoursesList" class="of">
		<div class="">
			<div class="container">
				<section class="path-wrap txtOf hLh30">
					<a class="c-999 fsize14" href="" title="">首页</a>
					\
					<a href="${channel.linkUrl!}" title="${channel.channelName!}" class="c-999 fsize14">${channel.channelName!}</a>
					\
					<span class="c-333 fsize14">课程列表</span>
				</section>
				<section class="c-s-dl coures-option">
					<dl>
						<dt>
							<span class="c-333">按分类：</span>
						</dt>
						<dd class="c-s-dl-li">
							<ul class="clearfix">
								<li <#if courseQuery.categoryId==0>class="current"</#if>><a title="全部" href="javascript:setCategoryId(0)">全部</a></li>
								<#list categoryRoots as category>
									<li <#if (courseQuery.categoryId==category.categoryId || categoryParentId==category.categoryId)>class="current"</#if>><a title="${category.categoryName}" href="javascript:setCategoryId(${category.categoryId})">${category.categoryName}</a></li>
								</#list>
							</ul>
							<aside class="c-s-more">
								<a href="javascript: void(0)" title="" class="fsize14 c-master icon-gd">&nbsp;</a>
								<div class="m-a-box">
									<section class="m-a-b-inf">
										<div class="DT-arrow">
											<em>◆</em>
											<span>◆</span>
										</div>
										<div class="m-a-b-more"></div>
									</section>
								</div>
							</aside>
						</dd>
					</dl>
					<#if categoryChildren?? && categoryChildren?size gt 0>
						<dl class="ejdl-box live-ejdl-b">
							<dt>
								<span class="c-999 fsize14 dis txtOf">子分类：</span>
							</dt>
							<dd class="c-s-dl-li">
								<ul class="clearfix">
									<#list categoryChildren as category>
										<li <#if courseQuery.categoryId==category.categoryId>class="current"</#if>><a title="${category.categoryName}" href="javascript:setCategoryId(${category.categoryId})">${category.categoryName}</a></li>
									</#list>
								</ul>
							</dd>
						</dl>
					</#if>
					<#--if serviceSwitch.member=='ON'>
						<dl class="teach-yjdl">
							<dt> <span class="c-333">按会员：</span> </dt>
							<dd class="c-s-dl-li">
								<ul class="clearfix">
									<li <#if courseQuery.memberTypeId==0>class="current"</#if>><a title="全部" onclick="memberType(0)" href="javascript:void(0)">全部</a></li>
									<#list memberTypeList as memberType>
										<li <#if memberType.id==courseQuery.memberTypeId>class="current"</#if>><a title="${memberType.title}" onclick="memberType(${memberType.id})" href="javascript:void(0)">${memberType.title}</a></li>
									</#list>
								</ul>
							</dd>
						</dl>
					</#if-->
					<div class="clear"></div>
				</section>
			</div>
		</div>
		<!-- 课程列表 开始 -->
		<section class="container">
			<section class="c-sort-box c-sort-box-new">
				<div class="js-wrap mb10">
					<section class="clearfix">
						<ol class="js-tap clearfix fl">
							<li <#if courseQuery.orderBy==0>class="current bg-orange"</#if>><a title="最新" href="javascript:setOrderBy(0)">最新</a></li>
							<li <#if courseQuery.orderBy==1>class="current bg-orange"</#if>><a title="最热" href="javascript:setOrderBy(1)">最热</a></li>
							<li class="pr <#if courseQuery.orderBy==3||courseQuery.orderBy==4>current</#if>">
								<a title="价格" href="javascript:setOrderBy(<#if courseQuery.orderBy==3>4<#else>3</#if>)">价格
									<span class="c-master fsize14 f-fM">
										<#if courseQuery.orderBy==3>↑</#if>
										<#if courseQuery.orderBy==4>↓</#if>
									</span>
								</a>
							</li>
						</ol>
						<article class="fr">
							<#if serviceSwitch.packageSwitch=='ON'>
								<label onclick="setPackage(this)" class="c-kcfl <#if courseQuery.sellType! =='PACKAGE'>check</#if> ml20">
									<em class="icon14 c-chb-ico"></em>
									<tt class="vam fsize14 c-666 f-fM">套 餐</tt>
								</label>
							</#if>
							<label onclick="setIsFree(this)" class="c-kcfl <#if courseQuery.isFree! == 1>check</#if>  ml20">
								<em class="icon14 c-chb-ico"></em>
								<tt class="vam fsize14 c-666 f-fM">免 费</tt>
							</label>
						</article>
					</section>
				</div>
				<#--列表数据 s-->
				<div class="layui-row layui-col-space12 search-course-list">
					<#if courseList?? && courseList?size gt 0>
						<#list courseList as courses>
							<div class="layui-col-md3 layui-col-xs12">
								<a href="/course/view/${courses.courseId!}.html" target="_blank">
									<div class="course-card_wrap">
										<div class="course-card_img">
											<div class="course-card-image">
												<img src="${courses.cover!}" class="doload-img">
											</div>
											<span class="tag">${courses.categoryName!}</span>
										</div>
										<div class="course-card_content">
											<div class="course-card_content_header">
												<span>${courses.courseName!}</span>
											</div>
											<div class="course-card_info">
												<div class="course-time">
													<span class="course-time_time">时间：${courses.addTime?date!}</span>
													<span class="course-time_class">${courses.lessonNum!}课时</span>
												</div>
											</div>
											<div class="buy-info">
												<div class="buy-info_left">
													<span class="buy-count">已有${courses.buyCount!}人购买</span>
												</div>
												<div class="buy-info_right">
													<#if courses.price gt 0>
														<span class="price">￥${courses.price/100}</span>
													<#else>
														<span class="price">免费</span>
													</#if>
													<#if courses.sourcePrice gt 0>
														<del>原价${courses.sourcePrice/100}</del>
													</#if>
												</div>
											</div>
										</div>
									</div>
								</a>
							</div>
						</#list>
					<#else>
						<section class="no-data-wrap">
							<em class="icon30 no-data-ico">&nbsp;</em> <span class="c-666 fsize14 ml10 vam">没有相关数据，小编正在努力整理中...</span>
						</section>
					</#if>
				</div>
				<!-- 公共分页 开始 -->
				<div class="paging" id="showPages"></div>
			</section>
		</section>
		<!-- /课程列表 结束 -->
	</div>
	<script type="text/javascript" src="/static/js/page.js"></script>
	<script type="text/javascript" src="/static/js/course/course-list.js"></script>
	<script type="text/javascript">
		$(function () {
			//分类更多按钮交互效果
			$(".c-s-dl>dl .c-s-more").each(function () {
				var _this = $(this),
						_uList = _this.siblings("ul"),
						_uLw = _uList.height();
				if (_uLw <= "50") {
					_this.hide();
				} else {
					_uList.css("height", "40px");
					_this.hover(function () {
						_this.children(".icon-gd").addClass("current");
						_this.children(".m-a-box").show();
					}, function () {
						_this.children(".icon-gd").removeClass("current");
						_this.children(".m-a-box").hide();
					});
					//把overflow：hidden 的li追加到 .m-a-b-more
					$(_uList).children("li").each(function (index, tag) {
						if ($(tag).position().top > $(_uList).find("li").eq(0).position().top) {
							var aHtml = $(tag).html();
							$(".m-a-b-more").append(aHtml);//追加节点
						}
					})
				}
			});
		})
	</script>
</#assign>
<#include "../layouts/layout.ftl">